﻿@{
    string absolutePath = HttpContext.Current.Request.Url.AbsolutePath;

    string autoCat = "rounded active";
    string tires = "rounded";
    string firms = "rounded";
    string autoSale = "rounded";
    string feedBack = "last rounded";
    

    if (absolutePath.ToLower().Contains("auto"))
    {
        autoCat = autoCat + " active";
    }

    if (absolutePath.ToLower().Contains("tires"))
    {
        tires = tires + " active";
        autoCat = autoCat.Replace("active", "");
    }


    if (absolutePath.ToLower().Contains("firms"))
    {
        firms = firms + " active";
        autoCat = autoCat.Replace("active", "");
    }
    
}
<ul>
    <li class="@autoCat"><a href=@Url.Action("Index", "Home")>Каталог авто</a> </li>
    <li class="@tires"><a href=@Url.Action("Index", "Tires")>Шины и диски</a> </li>
    <li class="@firms"><a href=@Url.Action("Index", "Firms")>Каталог фирм</a> </li>
    <li class="@autoSale"><a href="#">Продажа авто</a> </li>
    <li class="@feedBack"><a href="#">Отзывы</a> </li>
</ul>
